﻿Imports System.Collections.ObjectModel

Public Class FileType
    Private _Type As String
    Private _Count As Integer
    Private _Size As Integer
    Private _Files As New List(Of File)

    Public Property Type As String
        Get
            Return _Type
        End Get
        Set(value As String)
            _Type = value
        End Set
    End Property

    Public ReadOnly Property GetCount As Integer
        Get
            Return _Count
        End Get
    End Property

    Public Property Size As Integer
        Get
            Return _Size
        End Get
        Set(value As Integer)
            _Size = value
        End Set
    End Property

    Public ReadOnly Property Files As ReadOnlyCollection(Of File)
        Get
            Return _Files.AsReadOnly
        End Get
    End Property

    Public Sub add(ByRef file As File)
        _Count += 1
        _Files.Add(file)
        _Size += file.Size
    End Sub
End Class
